/*
	ShieldActive.h
	(c)2004 Palestar, Richard Lyle
*/

#ifndef SHIELD_ACTIVE_H
#define SHIELD_ACTIVE_H

#include "Game/GadgetShield.h"



//----------------------------------------------------------------------------

class ShieldActive : public GadgetShield
{
public:
	DECLARE_WIDGET_CLASS();

	// NounGadget interface
	int	addValue() const
	{
		return 6500;
	}
	Type type() const
	{
		return SHIELD;
	}
	float addSignature() const
	{
		return active() ? 0.5f : 0.0f;
	}
	int	maxDamage() const
	{
		return 3800 + (200 * level());
	}
	int buildTechnology() const
	{
		return 10;
	}
	int	buildCost() const
	{
		return 500;
	}
	dword buildFlags() const
	{
		return NounPlanet::FLAG_METALS;
	}
	int	buildTime() const
	{
		return 460;
	}
	// GadgetShield interface
	bool canDeflect( dword nType ) const
	{
		return (nType & (DAMAGE_KINETIC | DAMAGE_ENERGY | DAMAGE_ELF | DAMAGE_EMP)) != 0;
	}
	int	energyCost() const
	{
		// return ((3 * level()) / 5);
		return 4;
	}
	int chargeEnergyCost() const
	{
		// return ((2 * level()) / 4);
		return 1;
	}
	int maxCharge() const
	{
		return (37500 + (9800 * level())) * modifier();
	}//Add 2000 -JBUD-
	int chargeRate() const
	{
		return (maxCharge() / 9100);
		//return 8; //Returned level chargerate -JBUD-
	}
	float damageModifier( dword nType ) const
	{
		if ( nType & (DAMAGE_EMP) )
			return 1.5f;		// emp damage is more effective against this shield type - Reek - changed from 1.9 to 1.5
		return 1.0f;		//All other types less effective
	}//re-engaged EMP effectiveness against active shields
};

//----------------------------------------------------------------------------



#endif

//----------------------------------------------------------------------------
// EOF
